﻿namespace P7_todoList_wpf;

using System.ComponentModel;

public class TodoItem : INotifyPropertyChanged
{
    private string title;
    private string description;
    private string category;
    private DateTime dueDate;
    private bool isCompleted;

    public string Title
    {
        get => title;
        set { title = value; OnPropertyChanged(nameof(Title)); }
    }

    public string Description
    {
        get => description;
        set { description = value; OnPropertyChanged(nameof(Description)); }
    }

    public string Category
    {
        get => category;
        set { category = value; OnPropertyChanged(nameof(Category)); }
    }

    public DateTime DueDate
    {
        get => dueDate;
        set { dueDate = value; OnPropertyChanged(nameof(DueDate)); }
    }

    public bool IsCompleted
    {
        get => isCompleted;
        set { isCompleted = value; OnPropertyChanged(nameof(IsCompleted)); }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    protected void OnPropertyChanged(string propertyName)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}

